package site.lanmushan.framework.datascope.support;

import net.sf.jsqlparser.JSQLParserException;
import net.sf.jsqlparser.expression.Expression;

import java.util.Map;
import net.sf.jsqlparser.statement.Statement;

/**
 * @author Administrator
 */
public interface ISlashDataControl {

    String doSql(String sql) throws JSQLParserException;

    Statement doStatement(Statement statement) throws JSQLParserException;
    /**
     * 处理插入
     * @param statement
     * @return
     */
    Statement doInsert(Statement statement) throws JSQLParserException;

    /**
     * 处理查询
     * @param statement
     * @return
     */
    Statement doSelect(Statement statement) throws JSQLParserException;

    /**
     * 处理更新
     * @param statement
     * @return
     */
    Statement doUpdate(Statement statement) throws JSQLParserException;

    /**
     * 处理删除
     * @param statement
     * @return
     */
    Statement doDelete(Statement statement) throws JSQLParserException;

    /**
     * 注册拦截器
     * @param sqlType
     * @param interceptor
     */
    void registerInterceptor(String sqlType,SlashDataControlInterceptor interceptor);
    /**
     * 获取条件
     * @param tableMap
     * @return
     * @throws JSQLParserException
     */
   // Expression getSelectDataScopeCondition(Map<String, String> tableMap,String method) throws JSQLParserException;
}
